<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="a.header.jsp" %>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head> 
<!--  /layuiproject/WebContent/4弹出层/b1多层弹窗遮罩层方法调用.jsp -->
<body>
        <h1>第一层页面</h1>
        <button id="btn">打开第二层页面</button>
        <input id="test" value="test"></input>
        <script type="text/javascript">
        layui.use(['layer', 'form'], function(){
        	  var layer = layui.layer
        	  ,form = layui.form
        	  ,$=layui.$;
        	  
        	  layer.msg('Hello World');
        	  var openSecond=function(){
                  top.layer.open({
                      type: 2,
                      title: "第二层页面",
                      content: "b1多层弹窗遮罩层方法调用2.jsp",
                      area: ['1000px', '600px'],
                      success: function(layero, index){
                          //获取第二个页面
                          var iframe = window['layui-layer-iframe' + index];
                          //调用第二个页面的方法
                          iframe.firstParams("haha");
                      }
                  })
              }
        	  $("#btn").click(function(){
        		  openSecond();
              })
              //第一层页面方法
              function firstMethod(){
                  alert("firstMethod");
              }
        	});
        
    </script>
    </body>
    
</html> 